package com.example.demo.runner;

import com.example.demo.service.SensitiveWordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * <p>
 * 初始化
 * <p>
 *
 * @author hzm
 * @date  2022-10-9 
 */
@Slf4j
@Component
public class DataInitRunner implements CommandLineRunner {

    @Autowired
    private SensitiveWordService sensitiveWordService;

    @Override
    public void run(String... args) throws Exception {
        log.info("==================加载敏感词库==================");
        sensitiveWordService.syncSensitiveWord();
        log.info("==================结束加载敏感词库==================");
    }
}
